<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="#/home">首页</a>
</body>
<script>
    window.onpopstate = function(e){
        alert(
            "location: " +
            document.location +
            ", state: " +
            JSON.stringify(e.state)
        );
    };
    history.pushState({page:1},"title1","?page=1");
    history.pushState({page:2},"title2","?page=2");
    // history.replaceState({page:3},"title3","?page=3");

    history.back();

    // history.go(1);
</script>
</html>